package main

import (
	"fmt"
	"os"
	"io/ioutil"
)

func main(){
	file_path,_ := os.Getwd()

	//源文件
	file1Path := file_path + "/Demo.txt"
	//复制目标文件
	file2Path := file_path + "/Test2.txt"

	//对文件进行复制
	in,in_err := ioutil.ReadFile(file1Path)
	if in_err != nil{
		fmt.Println(in_err)
	}

	//写出文件
	out_err := ioutil.WriteFile(file2Path,in,0666)
	if out_err != nil{
		fmt.Println(out_err)
	}
}